import java.util.Arrays;

public class intInitialize {
    public static void main(String[] args) {
        int[]arr=new int[100];
        for(int i=0;i<100;i++){
            arr[i]=i+1;
        }
        System.out.println(Arrays.toString(arr));
        transform(arr,arr.length);
        System.out.println(sum(arr,arr.length));
        int[] arr2={1,2,3,4,5,6};
        Adjust(arr2,arr2.length);
        System.out.println(Arrays.toString(arr2));
    }
    public static void transform(int[] arr,int len){
        for(int i=0;i<len;i++){
            arr[i]*=2;
        }
        System.out.println(Arrays.toString(arr));
    }

    public static int sum(int[] arr,int len){
        int sum=0;
        for(int i=0;i<len;i++){
            sum+=arr[i];
        }
        return sum;
    }

    public static void Adjust(int[] arr,int len){
        int i=0;
        int j=len-1;
        while(i<j){
            while(arr[i]%2==1){
                i++;
            }
            while(arr[j]%2==0){
                j--;
            }
            if(i<j) {
                int tmp = arr[i];
                arr[i] = arr[j];
                arr[j] = tmp;
                i++;
                j--;
            }
        }
    }
}
